package com.xiang.controller;

import com.xiang.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("account")
public class AccountController {

    @Autowired
    private  AccountService accountService;

    @PostMapping("reduceMoney")
    void reduceMoney(@RequestParam("countId") int countId, @RequestParam("amount") double amount) {
        accountService.reduceMoney(countId,amount);

    }
}
